package com.beans.usercontoller;

import com.beans.userservice.UserService;
import com.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;


@Controller
public class UserController4 {
    //属性注入
    @Resource
    private UserService userService;

    public void sayHi(String name){
        System.out.println("Hi "+name);
    }
    public User getUserId(Integer id){
        //伪代码
        return userService.getUserById(id);
    }
}
